---
Title: "Supplementary Information: Sources of Sanction Fears from the Local Governance Performance Index 2019 Malawi for The ABCs of Covid-19 Prevention in Malawi: Authority, Benefits, and Costs of Compliance"

Forthcoming in World Development

Authors: Kristen Kao, Ellen Lust, Boniface Dulani,Karen Ferree, Adam Harris, and Erica Metheney 

Dataset citation: Lust, Ellen (PI); Dulani, Boniface; Harris, Adam; Ferree, Karen; Kao, Kristen; Metheney, Erica. 2020. The GLD-IPOR Covid-19 Survey in Malawi. www.gld.gu.se

R Script Author: "Erica A. Metheney"
Date: "July 28, 2020"
Output:
  word_document: default
  pdf_document: default
---


```{r setup, include=FALSE}
require("knitr")
require("summarytools")
knitr::opts_chunk$set(echo = FALSE, warning=FALSE, message = FALSE, comment=NA,prompt = FALSE, cache = FALSE, results = 'asis')
opts_knit$set(root.dir = "C:/Users/xmeter/ShareFile/Shared Folders/LGPI Index/Dimension Reports/Extraction")

st_options(bootstrap.css     = FALSE,       # Already part of the theme so no need for it
           plain.ascii       = FALSE,       # One of the essential settings
           style             = "rmarkdown", # Idem.
           dfSummary.silent  = TRUE,        # Suppresses messages about temporary files
           footnote          = NA,          # Keeping the results minimalistic
           subtitle.emphasis = FALSE)       # For the vignette theme, this gives better results.
                                            # For other themes, using TRUE might be preferable.

st_css()
```


```{r import}
dat = readRDS("C:/Users/xmeter/ShareFile/Shared Folders/MalawiCovid19Survey/Experiments/AuthorityDataRepositoryMaterials/Data/Supplemental/SupplementalData_LGPI2019.rda")
EDUC = dat[,1:48]
ELTY = dat[,49:96]
HLTH = dat[,97:144]
WTSN = dat[,145:192]
```

# Overview

We want to examine from whom Malawians fear sanctioning as it pertains to contributing to community initiatives. To do this, we will examine the Actions and Sanctions sections related to contributions to community initiatiaves related to

* Education
* Health
* Electricity
* Water \& Sanitation

In particular we will be analyzing the answers to questions starting with "Would you say that you contributed, at least partly, because..."

* others will think poorly of you or your household if you don't contribute? If yes, whom?
* you or your household will have to pay fines, lose property or suffer other material loss if you don't contribute? If yes, to/from whom?
* you will be physically punished if you don't contribute? If yes, by whom?

Since the same battery of questions was used for all initiatives, we will begin by pooling the results of all initiatives. Then we will investigate each intiative separately.

# Pooled Results

Here we combine the results for the three types of sanctions (think poorly, cause material loss, cause physical harm) across the 4 topics (education, heatlh, electricty, water and sanitation).

 
```{r relevantVars}
#educ: educ_q110,educ_q112,educ_q114
#elty: elty_q41,elty_q43,elty_q45
#hlth: hlth_q78,hlth_q80,hlth_q82
#wtsn: wtsn_q68,wtsn_q70,wtsn_q72

#think poorly: 1-7
#physical harm: 1- 7 
#material loss: 1 - 20

cap.topic = c("EDUC","ELTY","HLTH","WTSN")
lc.topic = c("educ","elty","hlth","wtsn")

think.poorly.num = c("110","41","78","68")

for(i in 1:4){
  df = get(cap.topic[i])
  for(j in 1: 7){
    if(j == 1){
      vec = df[,paste(lc.topic[i],"_q",think.poorly.num[i],"_",j,sep ="")]
    }else{
      vec = cbind(vec,df[,paste(lc.topic[i],"_q",think.poorly.num[i],"_",j,sep ="")])
    }
  }
  if(i == 1){
    think.poorly.df = vec
  }else{
    think.poorly.df = rbind(think.poorly.df,vec)
  }
}

physical.harm.num = c("114","45","82","72") 

for(i in 1:4){
  df = get(cap.topic[i])
  for(j in 1: 7){
    if(j == 1){
      vec = df[,paste(lc.topic[i],"_q",physical.harm.num[i],"_",j,sep ="")]
    }else{
      vec = cbind(vec,df[,paste(lc.topic[i],"_q",physical.harm.num[i],"_",j,sep ="")])
    }
  }
  
  if(i == 1){
    physical.harm.df = vec
  }else{
    physical.harm.df = rbind(physical.harm.df,vec)
  }
}


material.loss.num = c("112","43","80","70")

for(i in 1:4){
  df = get(cap.topic[i])
  for(j in 1: 20){
    if(j == 1){
      vec = df[,paste(lc.topic[i],"_q",material.loss.num[i],"_",j,sep ="")]
    }else{
      vec = cbind(vec,df[,paste(lc.topic[i],"_q",material.loss.num[i],"_",j,sep ="")])
    }
  }
  if(i == 1){
    material.loss.df = vec
  }else{
    material.loss.df = rbind(material.loss.df,vec)
  }
}

#make dfs and set column names
think.poorly.df = as.data.frame(think.poorly.df,stringsAsFactors = FALSE)
physical.harm.df = as.data.frame(physical.harm.df,stringsAsFactors = FALSE)
material.loss.df = as.data.frame(material.loss.df,stringsAsFactors = FALSE)
colnames(think.poorly.df) = c("Friends",
"Family",
"Local elders/village leaders",
"Gender Group",
"Ethnic group/leaders",
"Religious Group/leaders",
"Others locals")
colnames(physical.harm.df) = c("Family/Friends",
"Local elders/village leaders",
"Ethnic group/leaders",
"Religious Group/leaders",
"Political party leaders/supporters",
"Others locals",
"Others non-locals")
colnames(material.loss.df) = c("Village head/nghd (block) leader",
"Village/nghd chair",
"Ten House/Ten Cell leader",
"Local elder",
"Member of village/nghd comm.",
"Group Village Head",
"Assistant chief",
"Chief (Kenya)",
"Tribal chief",
"TA",
"Paramount chief",
"LC (Malawi/Zambia)",
"Ward Councilor",
"MCA",
"MP",
"Dist. Comm.",
"Business person",
"Prominent member of a political party",
"Village Devel. Comm. member",
"Religious leader")
```

## Who Will Think Poorly of You?

Sample Size: `r dim(think.poorly.df)[1] - sum(is.na(think.poorly.df[,1]))`

```{r table1}
tab1  = apply(think.poorly.df,2,sum,na.rm = TRUE)
denoms = dim(think.poorly.df)[1] - apply(think.poorly.df,2,FUN = function(x)  sum(is.na(x)))
myrownames = names(100*round(tab1/denoms,digits = 2))
tab1 = paste(100*round(tab1/denoms,digits = 2),"%",sep = "")
tab1 = data.frame(tab1)
colnames(tab1) = "Percent"
rownames(tab1) = myrownames
kable(tab1)
```

## Who Will Think Cause You to Suffer Material Loss?

Sample Size: `r dim(material.loss.df)[1] - sum(is.na(material.loss.df[,1]))`

```{r table2}
tab1  = apply(material.loss.df,2,sum,na.rm = TRUE)
denoms = dim(material.loss.df)[1] - apply(material.loss.df,2,FUN = function(x)  sum(is.na(x)))
myrownames = names(100*round(tab1/denoms,digits = 2))
tab1 = paste(100*round(tab1/denoms,digits = 2),"%",sep = "")
tab1 = data.frame(tab1)
colnames(tab1) = "Percent"
rownames(tab1) = myrownames
kable(tab1)
```

## Who Will Think Cause You Physical Harm?

Sample Size: `r dim(physical.harm.df)[1] - sum(is.na(physical.harm.df[,1]))`

```{r table3}
tab1  = apply(physical.harm.df,2,sum,na.rm = TRUE)
denoms = dim(physical.harm.df)[1] - apply(physical.harm.df,2,FUN = function(x)  sum(is.na(x)))
myrownames = names(100*round(tab1/denoms,digits = 2))
tab1 = paste(100*round(tab1/denoms,digits = 2),"%",sep = "")
tab1 = data.frame(tab1)
colnames(tab1) = "Percent"
rownames(tab1) = myrownames
kable(tab1)
```

```{r nums}
think.poorly.num = c("110","41","78","68")
physical.harm.num = c("114","45","82","72") 
material.loss.num = c("112","43","80","70")
```


# Education

```{r educ}


i = 1
  df = get(cap.topic[i])
  for(j in 1: 7){
    if(j == 1){
      vec = df[,paste(lc.topic[i],"_q",think.poorly.num[i],"_",j,sep ="")]
    }else{
      vec = cbind(vec,df[,paste(lc.topic[i],"_q",think.poorly.num[i],"_",j,sep ="")])
    }
  }

    think.poorly.df = vec



  df = get(cap.topic[i])
  for(j in 1: 7){
    if(j == 1){
      vec = df[,paste(lc.topic[i],"_q",physical.harm.num[i],"_",j,sep ="")]
    }else{
      vec = cbind(vec,df[,paste(lc.topic[i],"_q",physical.harm.num[i],"_",j,sep ="")])
    }
  }
  

    physical.harm.df = vec




  df = get(cap.topic[i])
  for(j in 1: 20){
    if(j == 1){
      vec = df[,paste(lc.topic[i],"_q",material.loss.num[i],"_",j,sep ="")]
    }else{
      vec = cbind(vec,df[,paste(lc.topic[i],"_q",material.loss.num[i],"_",j,sep ="")])
    }
  }

    material.loss.df = vec

#make dfs and set column names
think.poorly.df = as.data.frame(think.poorly.df,stringsAsFactors = FALSE)
physical.harm.df = as.data.frame(physical.harm.df,stringsAsFactors = FALSE)
material.loss.df = as.data.frame(material.loss.df,stringsAsFactors = FALSE)
colnames(think.poorly.df) = c("Friends",
"Family",
"Local elders/village leaders",
"Gender Group",
"Ethnic group/leaders",
"Religious Group/leaders",
"Others locals")
colnames(physical.harm.df) = c("Family/Friends",
"Local elders/village leaders",
"Ethnic group/leaders",
"Religious Group/leaders",
"Political party leaders/supporters",
"Others locals",
"Others non-locals")
colnames(material.loss.df) = c("Village head/nghd (block) leader",
"Village/nghd chair",
"Ten House/Ten Cell leader",
"Local elder",
"Member of village/nghd comm.",
"Group Village Head",
"Assistant chief",
"Chief (Kenya)",
"Tribal chief",
"TA",
"Paramount chief",
"LC (Malawi/Zambia)",
"Ward Councilor",
"MCA",
"MP",
"Dist. Comm.",
"Business person",
"Prominent member of a political party",
"Village Devel. Comm. member",
"Religious leader")
```

## Who Will Think Poorly of You?

Sample Size: `r dim(think.poorly.df)[1] - sum(is.na(think.poorly.df[,1]))`

```{r tableeduc1}
tab1  = apply(think.poorly.df,2,sum,na.rm = TRUE)
denoms = dim(think.poorly.df)[1] - apply(think.poorly.df,2,FUN = function(x)  sum(is.na(x)))
myrownames = names(100*round(tab1/denoms,digits = 2))
tab1 = paste(100*round(tab1/denoms,digits = 2),"%",sep = "")
tab1 = data.frame(tab1)
colnames(tab1) = "Percent"
rownames(tab1) = myrownames
kable(tab1)
```

## Who Will Think Cause You to Suffer Material Loss?

Sample Size: `r dim(material.loss.df)[1] - sum(is.na(material.loss.df[,1]))`

```{r tableeduc2}
tab1  = apply(material.loss.df,2,sum,na.rm = TRUE)
denoms = dim(material.loss.df)[1] - apply(material.loss.df,2,FUN = function(x)  sum(is.na(x)))
myrownames = names(100*round(tab1/denoms,digits = 2))
tab1 = paste(100*round(tab1/denoms,digits = 2),"%",sep = "")
tab1 = data.frame(tab1)
colnames(tab1) = "Percent"
rownames(tab1) = myrownames
kable(tab1)
```



## Who Will Think Cause You Physical Harm?

Sample Size: `r dim(physical.harm.df)[1] - sum(is.na(physical.harm.df[,1]))`

```{r tableeduc3}
tab1  = apply(physical.harm.df,2,sum,na.rm = TRUE)
denoms = dim(physical.harm.df)[1] - apply(physical.harm.df,2,FUN = function(x)  sum(is.na(x)))
myrownames = names(100*round(tab1/denoms,digits = 2))
tab1 = paste(100*round(tab1/denoms,digits = 2),"%",sep = "")
tab1 = data.frame(tab1)
colnames(tab1) = "Percent"
rownames(tab1) = myrownames
kable(tab1)
```

# Electricity


```{r elty}
i = 2
  df = get(cap.topic[i])
  for(j in 1: 7){
    if(j == 1){
      vec = df[,paste(lc.topic[i],"_q",think.poorly.num[i],"_",j,sep ="")]
    }else{
      vec = cbind(vec,df[,paste(lc.topic[i],"_q",think.poorly.num[i],"_",j,sep ="")])
    }
  }

    think.poorly.df = vec


  df = get(cap.topic[i])
  for(j in 1: 7){
    if(j == 1){
      vec = df[,paste(lc.topic[i],"_q",physical.harm.num[i],"_",j,sep ="")]
    }else{
      vec = cbind(vec,df[,paste(lc.topic[i],"_q",physical.harm.num[i],"_",j,sep ="")])
    }
  }
  

    physical.harm.df = vec




  df = get(cap.topic[i])
  for(j in 1: 20){
    if(j == 1){
      vec = df[,paste(lc.topic[i],"_q",material.loss.num[i],"_",j,sep ="")]
    }else{
      vec = cbind(vec,df[,paste(lc.topic[i],"_q",material.loss.num[i],"_",j,sep ="")])
    }
  }

    material.loss.df = vec

#make dfs and set column names
think.poorly.df = as.data.frame(think.poorly.df,stringsAsFactors = FALSE)
physical.harm.df = as.data.frame(physical.harm.df,stringsAsFactors = FALSE)
material.loss.df = as.data.frame(material.loss.df,stringsAsFactors = FALSE)
colnames(think.poorly.df) = c("Friends",
"Family",
"Local elders/village leaders",
"Gender Group",
"Ethnic group/leaders",
"Religious Group/leaders",
"Others locals")
colnames(physical.harm.df) = c("Family/Friends",
"Local elders/village leaders",
"Ethnic group/leaders",
"Religious Group/leaders",
"Political party leaders/supporters",
"Others locals",
"Others non-locals")
colnames(material.loss.df) = c("Village head/nghd (block) leader",
"Village/nghd chair",
"Ten House/Ten Cell leader",
"Local elder",
"Member of village/nghd comm.",
"Group Village Head",
"Assistant chief",
"Chief (Kenya)",
"Tribal chief",
"TA",
"Paramount chief",
"LC (Malawi/Zambia)",
"Ward Councilor",
"MCA",
"MP",
"Dist. Comm.",
"Business person",
"Prominent member of a political party",
"Village Devel. Comm. member",
"Religious leader")
```

## Who Will Think Poorly of You?

Sample Size: `r dim(think.poorly.df)[1] - sum(is.na(think.poorly.df[,1]))`

```{r tableelty1}
tab1  = apply(think.poorly.df,2,sum,na.rm = TRUE)
denoms = dim(think.poorly.df)[1] - apply(think.poorly.df,2,FUN = function(x)  sum(is.na(x)))
myrownames = names(100*round(tab1/denoms,digits = 2))
tab1 = paste(100*round(tab1/denoms,digits = 2),"%",sep = "")
tab1 = data.frame(tab1)
colnames(tab1) = "Percent"
rownames(tab1) = myrownames
kable(tab1)
```

## Who Will Think Cause You to Suffer Material Loss?

Sample Size: `r dim(material.loss.df)[1] - sum(is.na(material.loss.df[,1]))`

```{r tableelty2}
tab1  = apply(material.loss.df,2,sum,na.rm = TRUE)
denoms = dim(material.loss.df)[1] - apply(material.loss.df,2,FUN = function(x)  sum(is.na(x)))
myrownames = names(100*round(tab1/denoms,digits = 2))
tab1 = paste(100*round(tab1/denoms,digits = 2),"%",sep = "")
tab1 = data.frame(tab1)
colnames(tab1) = "Percent"
rownames(tab1) = myrownames
kable(tab1)
```

## Who Will Think Cause You Physical Harm?

Sample Size: `r dim(physical.harm.df)[1] - sum(is.na(physical.harm.df[,1]))`

```{r tableelty3}
tab1  = apply(physical.harm.df,2,sum,na.rm = TRUE)
denoms = dim(physical.harm.df)[1] - apply(physical.harm.df,2,FUN = function(x)  sum(is.na(x)))
myrownames = names(100*round(tab1/denoms,digits = 2))
tab1 = paste(100*round(tab1/denoms,digits = 2),"%",sep = "")
tab1 = data.frame(tab1)
colnames(tab1) = "Percent"
rownames(tab1) = myrownames
kable(tab1)
```


# Health


```{r hlth}
i = 3
  df = get(cap.topic[i])
  for(j in 1: 7){
    if(j == 1){
      vec = df[,paste(lc.topic[i],"_q",think.poorly.num[i],"_",j,sep ="")]
    }else{
      vec = cbind(vec,df[,paste(lc.topic[i],"_q",think.poorly.num[i],"_",j,sep ="")])
    }
  }

    think.poorly.df = vec



  df = get(cap.topic[i])
  for(j in 1: 7){
    if(j == 1){
      vec = df[,paste(lc.topic[i],"_q",physical.harm.num[i],"_",j,sep ="")]
    }else{
      vec = cbind(vec,df[,paste(lc.topic[i],"_q",physical.harm.num[i],"_",j,sep ="")])
    }
  }
  
    physical.harm.df = vec




  df = get(cap.topic[i])
  for(j in 1: 20){
    if(j == 1){
      vec = df[,paste(lc.topic[i],"_q",material.loss.num[i],"_",j,sep ="")]
    }else{
      vec = cbind(vec,df[,paste(lc.topic[i],"_q",material.loss.num[i],"_",j,sep ="")])
    }
  }

    material.loss.df = vec

#make dfs and set column names
think.poorly.df = as.data.frame(think.poorly.df,stringsAsFactors = FALSE)
physical.harm.df = as.data.frame(physical.harm.df,stringsAsFactors = FALSE)
material.loss.df = as.data.frame(material.loss.df,stringsAsFactors = FALSE)
colnames(think.poorly.df) = c("Friends",
"Family",
"Local elders/village leaders",
"Gender Group",
"Ethnic group/leaders",
"Religious Group/leaders",
"Others locals")
colnames(physical.harm.df) = c("Family/Friends",
"Local elders/village leaders",
"Ethnic group/leaders",
"Religious Group/leaders",
"Political party leaders/supporters",
"Others locals",
"Others non-locals")
colnames(material.loss.df) = c("Village head/nghd (block) leader",
"Village/nghd chair",
"Ten House/Ten Cell leader",
"Local elder",
"Member of village/nghd comm.",
"Group Village Head",
"Assistant chief",
"Chief (Kenya)",
"Tribal chief",
"TA",
"Paramount chief",
"LC (Malawi/Zambia)",
"Ward Councilor",
"MCA",
"MP",
"Dist. Comm.",
"Business person",
"Prominent member of a political party",
"Village Devel. Comm. member",
"Religious leader")
```

## Who Will Think Poorly of You?

Sample Size: `r dim(think.poorly.df)[1] - sum(is.na(think.poorly.df[,1]))`

```{r tablehlth1}
tab1  = apply(think.poorly.df,2,sum,na.rm = TRUE)
denoms = dim(think.poorly.df)[1] - apply(think.poorly.df,2,FUN = function(x)  sum(is.na(x)))
myrownames = names(100*round(tab1/denoms,digits = 2))
tab1 = paste(100*round(tab1/denoms,digits = 2),"%",sep = "")
tab1 = data.frame(tab1)
colnames(tab1) = "Percent"
rownames(tab1) = myrownames
kable(tab1)
```

## Who Will Think Cause You to Suffer Material Loss?

Sample Size: `r dim(material.loss.df)[1] - sum(is.na(material.loss.df[,1]))`

```{r tablehlth2}
tab1  = apply(material.loss.df,2,sum,na.rm = TRUE)
denoms = dim(material.loss.df)[1] - apply(material.loss.df,2,FUN = function(x)  sum(is.na(x)))
myrownames = names(100*round(tab1/denoms,digits = 2))
tab1 = paste(100*round(tab1/denoms,digits = 2),"%",sep = "")
tab1 = data.frame(tab1)
colnames(tab1) = "Percent"
rownames(tab1) = myrownames
kable(tab1)
```

## Who Will Think Cause You Physical Harm?

Sample Size: `r dim(physical.harm.df)[1] - sum(is.na(physical.harm.df[,1]))`

```{r tablehlth3}
tab1  = apply(physical.harm.df,2,sum,na.rm = TRUE)
denoms = dim(physical.harm.df)[1] - apply(physical.harm.df,2,FUN = function(x)  sum(is.na(x)))
myrownames = names(100*round(tab1/denoms,digits = 2))
tab1 = paste(100*round(tab1/denoms,digits = 2),"%",sep = "")
tab1 = data.frame(tab1)
colnames(tab1) = "Percent"
rownames(tab1) = myrownames
kable(tab1)
```



# Water and Sanitation


```{r wtsn}
i = 4
  df = get(cap.topic[i])
  for(j in 1: 7){
    if(j == 1){
      vec = df[,paste(lc.topic[i],"_q",think.poorly.num[i],"_",j,sep ="")]
    }else{
      vec = cbind(vec,df[,paste(lc.topic[i],"_q",think.poorly.num[i],"_",j,sep ="")])
    }
  }

    think.poorly.df = vec



  df = get(cap.topic[i])
  for(j in 1: 7){
    if(j == 1){
      vec = df[,paste(lc.topic[i],"_q",physical.harm.num[i],"_",j,sep ="")]
    }else{
      vec = cbind(vec,df[,paste(lc.topic[i],"_q",physical.harm.num[i],"_",j,sep ="")])
    }
  }
  
  physical.harm.df = vec




  df = get(cap.topic[i])
  for(j in 1: 20){
    if(j == 1){
      vec = df[,paste(lc.topic[i],"_q",material.loss.num[i],"_",j,sep ="")]
    }else{
      vec = cbind(vec,df[,paste(lc.topic[i],"_q",material.loss.num[i],"_",j,sep ="")])
    }
  }
    material.loss.df = vec
#make dfs and set column names
think.poorly.df = as.data.frame(think.poorly.df,stringsAsFactors = FALSE)
physical.harm.df = as.data.frame(physical.harm.df,stringsAsFactors = FALSE)
material.loss.df = as.data.frame(material.loss.df,stringsAsFactors = FALSE)
colnames(think.poorly.df) = c("Friends",
"Family",
"Local elders/village leaders",
"Gender Group",
"Ethnic group/leaders",
"Religious Group/leaders",
"Others locals")
colnames(physical.harm.df) = c("Family/Friends",
"Local elders/village leaders",
"Ethnic group/leaders",
"Religious Group/leaders",
"Political party leaders/supporters",
"Others locals",
"Others non-locals")
colnames(material.loss.df) = c("Village head/nghd (block) leader",
"Village/nghd chair",
"Ten House/Ten Cell leader",
"Local elder",
"Member of village/nghd comm.",
"Group Village Head",
"Assistant chief",
"Chief (Kenya)",
"Tribal chief",
"TA",
"Paramount chief",
"LC (Malawi/Zambia)",
"Ward Councilor",
"MCA",
"MP",
"Dist. Comm.",
"Business person",
"Prominent member of a political party",
"Village Devel. Comm. member",
"Religious leader")

```

## Who Will Think Poorly of You?

Sample Size: `r dim(think.poorly.df)[1] - sum(is.na(think.poorly.df[,1]))`

```{r tablewtsn1}
tab1  = apply(think.poorly.df,2,sum,na.rm = TRUE)
denoms = dim(think.poorly.df)[1] - apply(think.poorly.df,2,FUN = function(x)  sum(is.na(x)))
myrownames = names(100*round(tab1/denoms,digits = 2))
tab1 = paste(100*round(tab1/denoms,digits = 2),"%",sep = "")
tab1 = data.frame(tab1)
colnames(tab1) = "Percent"
rownames(tab1) = myrownames
kable(tab1)
```

## Who Will Think Cause You to Suffer Material Loss?

Sample Size: `r dim(material.loss.df)[1] - sum(is.na(material.loss.df[,1]))`

```{r tablewtsn2}
tab1  = apply(material.loss.df,2,sum,na.rm = TRUE)
denoms = dim(material.loss.df)[1] - apply(material.loss.df,2,FUN = function(x)  sum(is.na(x)))
myrownames = names(100*round(tab1/denoms,digits = 2))
tab1 = paste(100*round(tab1/denoms,digits = 2),"%",sep = "")
tab1 = data.frame(tab1)
colnames(tab1) = "Percent"
rownames(tab1) = myrownames
kable(tab1)
```

## Who Will Think Cause You Physical Harm?

Sample Size: `r dim(physical.harm.df)[1] - sum(is.na(physical.harm.df[,1]))`

```{r tablewtsn3}
tab1  = apply(physical.harm.df,2,sum,na.rm = TRUE)
denoms = dim(physical.harm.df)[1] - apply(physical.harm.df,2,FUN = function(x)  sum(is.na(x)))
myrownames = names(100*round(tab1/denoms,digits = 2))
tab1 = paste(100*round(tab1/denoms,digits = 2),"%",sep = "")
tab1 = data.frame(tab1)
colnames(tab1) = "Percent"
rownames(tab1) = myrownames
kable(tab1)
```
